<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>智能金库外币管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Loading Bootstrap -->
    <link href="../../css/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href="../../css/bootstrap-treeview.min.css" rel="stylesheet">

    <link rel="shortcut icon" href="../../img/favicon.ico">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
      <script src="../dist/js/vendor/html5shiv.js"></script>
      <script src="../dist/js/vendor/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container">
      <br>
      <div class="well well-lg" style="margin-bottom: 0px;">
        <h1>权限列表</h1>
        <br>
        <div id="tree"></div>
        <div align="right"  style="margin-bottom:10px;padding-top: 5px;">
          <button class="btn btn-primary" onclick="window.open('../base/add_org.html')">保存</button>
        </div>
      </div>
    </div>
    <!-- /.container -->


    <!-- jQuery (necessary for Flat UI's JavaScript plugins) -->
    <script src="../../js/vendor/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="../../js/vendor/video.js"></script>
    <script src="../../js/bootstrap-treeview.min.js"></script>
    <script type="text/javascript">
      function getTree() {
        // Some logic to retrieve, or generate tree structure
        var data = [
                    {
                      text: "用户管理",
                      color: "#00CC00",
                      backColor: "#FFFFFF",
                      nodes: [
                        {
                          text: "用户管理",
                          color: "#00CC00",
                          backColor: "#FFFFFF",
                          nodes: [
                            {
                              text: "查看用户",
                              color: "#00CC00",
                              backColor: "#FFFFFF",
                              nodes: [
                                {
                                  text: "查看",
                                  color: "#00CC00",
                                  backColor: "#FFFFFF"
                                },
                                {
                                  text: "查询",
                                  color: "#00CC00",
                                  backColor: "#FFFFFF"
                                },
                                {
                                  text: "查看权限",
                                  color: "#00CC00",
                                  backColor: "#FFFFFF"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          text: "角色管理",
                          color: "#00CC00",
                          backColor: "#FFFFFF"
                        }
                      ]
                    },
                    {
                      text: "基础数据",
                      color: "#00CC00",
                      backColor: "#FFFFFF"
                    },
                    {
                      text: "外币管理",
                      color: "#00CC00",
                      backColor: "#FFFFFF"
                    },
                    {
                      text: "纸币管理",
                      color: "#00CC00",
                      backColor: "#FFFFFF"
                    },
                    {
                      text: "设备监控",
                      color: "#00CC00",
                      backColor: "#FFFFFF"
                    },
                    {
                      text: "报表管理",
                      color: "#00CC00",
                      backColor: "#FFFFFF"
                    }
                  ];
        return data;
      }

      $('#tree').treeview({
        data: getTree(),         // 数据源
        showCheckbox: true,   //是否显示复选框
        highlightSelected: true,    //是否高亮选中
        //nodeIcon: 'glyphicon glyphicon-user',    //节点上的图标
        //nodeIcon: 'glyphicon glyphicon-globe',
        emptyIcon: '',    //没有子节点的节点图标
        multiSelect: false,    //多选
        onNodeChecked: function (event,data) {
            alert(data.nodeId);
        },
        onNodeSelected: function (event, data) {
            alert(data.nodeId);
        }
      });
    </script>
  </body>
</html>
